package com.anzia.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;

import java.util.Calendar;

/**
 *@ClassName LoginController
 *@Description
 *@Author Anzia.
 *@Date 2021/5/6 10:13
 *@Version 1.0
 **/
@Controller
public class LoginController {

    @GetMapping("/toLoginPage")
    public String toLoginPage(Model model) {
        model.addAttribute("currentYear", Calendar.getInstance().get(Calendar.YEAR));
        return "login";
    }

    @ModelAttribute("institute")
    public String getInstitute() {
        return "广东财经大学";
    }
}
